<template>
  <div>
    <nav class="toback">
       <p>后台管理</p>
    </nav>
    <Tabs type="card" >
        <Tab-pane label="银行信息">
           <Tabs size="small">
            <Tab-pane label="银行管理">
              <BankList></BankList>
            </Tab-pane>
            <Tab-pane label="添加银行">
              <BankAdd></BankAdd>
            </Tab-pane>
          </Tabs>
        </Tab-pane>
        <Tab-pane label="用户管理">
           <Tabs size="small">
            <Tab-pane label="查询所有用户">
              <UserList></UserList>
            </Tab-pane>
          </Tabs>
        </Tab-pane>
        <Tab-pane label="平台内办卡用户管理">
           <Tabs size="small">
            <Tab-pane label="办卡用户列表">
              <BkUserList></BkUserList>
            </Tab-pane>
          </Tabs>
        </Tab-pane>
        <Tab-pane label="Pos机消费录入">
           <Tabs size="small">
            <!-- <Tab-pane label="请手动录入">
              <PosXflr></PosXflr>
            </Tab-pane> -->
            <Tab-pane label="导入收益列表">
              <DaorulList></DaorulList>
            </Tab-pane>
            <Tab-pane label="导入">
              <PosDaoru></PosDaoru>
            </Tab-pane>
          </Tabs>
        </Tab-pane>

        <Tab-pane label="收益记录">
           <Tabs size="small">
            <Tab-pane label="平台收益记录">
              <PtsyjlList></PtsyjlList>
            </Tab-pane>
            <Tab-pane label="用户收益记录">
              <YhsyjlList></YhsyjlList>
            </Tab-pane>
          </Tabs>
        </Tab-pane>

        <Tab-pane label="pos机管理">
           <Tabs size="small">
            <Tab-pane label="pos机管理">
              <PosList></PosList>
            </Tab-pane>
             <Tab-pane label="添加pos机">
              <PosAdd></PosAdd>
            </Tab-pane>
          </Tabs>
        </Tab-pane>

         <Tab-pane label="合伙人管理">
           <Tabs size="small">
            <Tab-pane label="合伙人管理">
              <PosUserList></PosUserList>
            </Tab-pane>
            <Tab-pane label="POS机发货管理">
              <PosFahuoList></PosFahuoList>
            </Tab-pane>
          </Tabs>
        </Tab-pane>

        <Tab-pane label="图片说明管理">
           <Tabs size="small">
            <Tab-pane label="图片说明管理">
              <ImgsUrlList></ImgsUrlList>
            </Tab-pane>
          </Tabs>
        </Tab-pane>

        <Tab-pane label="提现管理">
           <Tabs size="small">
            <Tab-pane label="提现管理">
              <TxglList></TxglList>
            </Tab-pane>
          </Tabs>
        </Tab-pane>

        <Tab-pane label="提额管理">
           <Tabs size="small">
            <Tab-pane label="提额管理">
              <TeglList></TeglList>
            </Tab-pane>
          </Tabs>
        </Tab-pane>





        <Tab-pane label="管理员">
          <Tabs size="small">
            <Tab-pane label="添加管理员">
              账号：<i-input v-model="username" placeholder="请输入账号" style="width: 300px"></i-input>
              <br/>
              <br/>
              密码：<i-input type="password" v-model="password" placeholder="请输入密码" style="width: 300px"></i-input>
              <br/>
              <br/>
              <i-button type="info"  @click="handleAddManager">添加</i-button>
            </Tab-pane>
            <Tab-pane label="密码修改">
              <ManagerUpdate></ManagerUpdate>
            </Tab-pane>
          </Tabs>
        </Tab-pane>
    </Tabs>




  </div>




</template>

<script>
import axios from 'axios'
import ManagerUpdate from './home/ManagerUpdate'
import UserJihuo from './home/UserJihuo'
import UserList from './home/UserList'
import BkUserList from './home/BkUserList'
import BankList from './home/BankList'
import BankAdd from './home/BankAdd'
import PosList from './home/PosList'
import PosAdd from './home/PosAdd'
import PosXflr from './home/PosXflr'
import PosUserList from './home/PosUserList'
import PosFahuoList from './home/PosFahuoList'
import ImgsUrlList from './home/ImgsUrlList'
import TxglList from './home/TxglList'
import TeglList from './home/TeglList'
import PtsyjlList from './home/PtsyjlList'
import YhsyjlList from './home/YhsyjlList'
import PosDaoru from './home/PosDaoru'
import DaorulList from './home/DaorulList'











export default {
  name: 'Mhome',
  components: {
    ManagerUpdate,
    UserJihuo,
    UserList,
    BankList,
    BankAdd,
    PosList,
    PosAdd,
    BkUserList,
    PosXflr,
    PosUserList,
    PosFahuoList,
    ImgsUrlList,
    TxglList,
    TeglList,
    PtsyjlList,
    YhsyjlList,
    PosDaoru,
    DaorulList,
  },
  data () {
    return {
      username:'',
      password:''
    }
  },
  methods: {
    handleAddManager(){
      if(this.jianyan()){
         axios.post('/web/api/manager/add',{"username":this.username,"password":this.password}).then(this.handleAddInfoSucc)
      }
    },
    handleAddInfoSucc (res) {
      var data = res.data
      console.log('tag',data)
      this.$Message.success(data.message)
    },
    jianyan(){
      if(this.username === ''){
        this.$Message.success("请输入账号");
        return false;
      }else if(this.password === ''){
        this.$Message.success("请输入密码");
        return false;
      }else{
        return true
      }
    }
  }
}
</script>
<style lang="stylus" scoped>
.toback {
    width: 100%;
    font-size: 1.8rem;
    line-height: 2.6;
    background #358ff0
    p {
      text-align: center;
      color: #ffffff;
    }
}
</style>

